gusucode.com > 《MATLAB图像与视频处理实用案例详解》代码 > 《MATLAB图像与视频处理实用案例详解》代码/第 07 章 基于主成分分析的人脸二维码识别/OpenImageFile.m

    function filePath = OpenImageFile(imgfilePath)

if nargin < 1
    imgfilePath = fullfile(pwd, 'images/01.BMP');
end
[filename, pathname, filterindex] = uigetfile( ...
    { '*.bmp;*.jpg;*.tif;*.png;*.gif','All Image Files';...
    '*.*',  '所有文件 (*.*)'}, ...
    '选择视频文件', ...
    'MultiSelect', 'off', ...
    imgfilePath);
filePath = 0;
if isequal(filename, 0) || isequal(pathname, 0)
    return;
end
filePath = fullfile(pathname, filename);